<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>游戏下载</title>
    <style>
        /* 全局样式 */
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f4f4f4;
        }
        /* 时间显示区域 */
        .time {
            position: fixed;
            top: 10px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 1000;
            font-weight: bold;
            color: #007bff;
        }
        /* 登录区域 */
        .login {
            position: fixed;
            top: 10px;
            right: 10px;
            z-index: 1000;
            font-weight: bold;
        }
       
        /* 文档区域 */
        .login1 {
            position: fixed ;
            top: 10px;
            left: 10px;
            z-index: 1000;
            font-weight: bold;
            border: 2px solid #c2c5ce; 
            padding: 5px 10px;
            border-radius: 5px;
            text-decoration: none; /* 去除链接下划线 */
        }
        .login a {
            text-decoration: none;
            color: #007bff;
            padding: 5px 10px;
            border: 1px solid #007bff;
            border-radius: 3px;
            transition: background-color 0.3s ease, color 0.3s ease;
        }

        .login a:hover {
            background-color: #007bff;
            color: white;
        }
        /* 联系我区域 */
        .contact {
            position: fixed;
            top: 50px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 1000;
            font-size: 2em;
            font-weight: bold;
        }
        .contact span {
            display: none;
            font-size: 0.5em;
            color: #007bff;
        }
        .contact:hover span {
            display: inline-block;
            font-size: 1em; /* 将字体大小扩大2倍 */
        }
        /* 页面容器 */
        .container {
            width: 70%;
            margin: 140px auto; /* 向下移动40px */
            background-color: rgb(201, 14, 14);
            padding: 20px;
            border-radius: 5px;
            box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
            transform: scale(1.25); /* 整体扩大1.25倍 */
            transform-origin: top center; /* 确保扩大后居中 */
        }
        /* 游戏标题 */
        h1 {
            text-align: center;
            margin-bottom: 10px;
        }

        /* 游戏图片 */
        .game-img {
            display: block;
            width: 200px;
            height: 200px;
            margin: 0 auto 10px;
            border-radius: 10px;
        }

        /* 游戏描述 */
        p {
            line-height: 1.6;
            margin-bottom: 20px;
            text-align: center
        }

        /* 下载按钮 */
        .download-btn {
            display: block;
            width: 150px;
            margin: 30px auto 0;
            padding: 10px;
            background-color: #007bff;
            color: white;
            text-align: center;
            text-decoration: none;
            border-radius: 5px;
            transition: background-color 0.3s ease;
        }

        .download-btn:hover {
            background-color: #0056b3;
        }
    </style>
    <script>
        function checkLogin(event, href) {
            event.preventDefault(); // 阻止默认跳转行为

            // 检查 localStorage 中是否存在用户登录信息
            var savedUsername = localStorage.getItem("username");
            var savedPassword = localStorage.getItem("password");

            if (!savedUsername || !savedPassword) {
                alert("请先登录！");
                window.location.href = "index/登录.html"; // 跳转到登录页面
            } else {
                window.location.href = href; // 已登录，正常跳转
            }
        }

        function updateTime() {
            var now = new Date();
            var year = now.getFullYear();
            var month = (now.getMonth() + 1).toString().padStart(2, '0');
            var day = now.getDate().toString().padStart(2, '0');
            var timeString = now.toLocaleTimeString();
            var dateTimeString = `${year}-${month}-${day} ${timeString}`;
            document.getElementById("current-time").textContent = dateTimeString;
        }

        // 每秒更新一次时间
        setInterval(updateTime, 1000);
    </script>
</head>

<body>
    <div class="time" id="current-time"></div>
    <div class="contact" style="position: fixed; top: 50px; left: 50%; transform: translateX(-50%); z-index: 1000; font-size: 2em; font-weight: bold;">
        联系我
        <span>zhuxiaoyi_zxy</span>
    </div>
    <div class="login">
        <a href="index/登录.html">登录</a>
    </div>
    <div class="login1">
        <a href="resources/Document.html" onclick="checkLogin(event, 'resources/Document.html')">文档</a>
    </div>
    <div class="container">
        <h1>神秘冒险游戏</h1>
        <img src="img/3.jpg"  class="game-img">
        <p>这是一款充满奇幻色彩的冒险游戏，你将置身神秘世界，探索未知领域，解开重重谜题，与各种神奇生物邂逅。</p>
        <a href="resources/dome01.exe" class="download-btn" download onclick="checkLogin(event, 'resources/dome01.exe')">立即下载</a>
    </div>
</body>

</html>